
<!DOCTYPE html>
<html>
<!--Made By kailuosoft.com, TEL 171 9992 9517 -->
<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">


    <title>凯络科技后台管理系统 - 入库登记</title>
    <meta name="keywords" content="">
    <meta name="description" content="">

     <link rel="shortcut icon" href="favicon.ico"> <link href="__PUBLIC__/css/bootstrap.min14ed.css?v=3.3.6" rel="stylesheet">
    <link href="__PUBLIC__/css/font-awesome.min93e3.css?v=4.4.0" rel="stylesheet">
    <link href="__PUBLIC__/css/plugins/iCheck/custom.css" rel="stylesheet">
    <link href="__PUBLIC__/css/animate.min.css" rel="stylesheet">
    <link href="__PUBLIC__/css/style.min862f.css?v=4.1.0" rel="stylesheet">
	<link href="__PUBLIC__/css/page.css" rel="stylesheet">
    <link href="__PUBLIC__/css/new.css" rel="stylesheet">
	<script src="__PUBLIC__/js/jquery.min63b9.js?v=2.1.4"></script>
    <script src="__PUBLIC__/js/plugins/layer/layer.min.js"></script>
    
   
    <script>
	   $(document).ready(function(){
		     $('#submit').click(function(){
				  shop=$('#shop').val();
				  goods=$('#goods').val();
				  
				  if(shop=='')
				  {
					  layer.alert('请选择销售平台');
					  return false;
				  }
				  
				  if(goods=='')
				  {
					  layer.alert('请选择商品');
					  return false;
				  }
			  })
			  
			 $('#shop').change(function(){
				    shop=$(this).val();
					$.ajax({
						 url:'shop_goods',
						 type:'POST',
						 //dataType:'json',
						 data:'shop='+shop,
						 success:function(res){
							     
								 $('#goods').html(res);
						    }
							 
					  })
			   })
		 })
    </script>
	
</head>

<body class="gray-bg">
    <div class="wrapper wrapper-content animated fadeInRight">
        <div class="row">
            <div class="col-sm-12">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <if condition=" empty($stockinfo)"> 
                           <h5>入库登记</h5>
                        <else/>
                           <h5>库存编辑</h5>
                        </if>
                        
                    </div>
                    <div class="ibox-content">
                        <form class="form-horizontal m-t" id="commentForm" action="{:U('stock_add')}" method="post">
							<input type='hidden' name="id" id='id' value='<if condition=" !empty($stockinfo)"> {$stockinfo.id} </if>' />
                            <input type='hidden' name="jumpurl" id='jumpurl' value='<if condition=" !empty($jumpurl)"> {$jumpurl} </if>' />
                           <!-- <div class="form-group">
                                <label class="col-sm-3 control-label">销售平台：</label>
                                <div class="col-sm-2">
                                    <select class="form-control" name='shop' id='shop'>
                                     <option value=''>请选择</option>
                                     <if condition=" $shop_list ">  
                                		<foreach name="shop_list" item="shop" >
                                         <option value='{$shop.id}' <?php echo ($stockinfo['shop']==$shop['id'])?'selected':'' ?> >{$shop.shop_name}</option>
                                        </foreach>
                                      </if>
                                    </select>
                                </div>
                            </div>-->
                            
                            <div class="form-group">
                                <label class="col-sm-3 control-label">姓名：</label>
                                <div class="col-sm-2">
                                    <input id="name" name="name" minlength="2" type="text" class="form-control" required aria-required="true" placeholder='请输入姓名' autocomplete="off"  onfocus="this.type='text'" value='<if condition=" !empty($stockinfo)"> {$stockinfo.name}<else/>1 </if>'>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label">电话：</label>
                                <div class="col-sm-2">
                                    <input id="phone" type="text" class="form-control" name="phone"  placeholder='请输入电话' value='<if condition=" !empty($stockinfo)"> {$stockinfo.phone}<else/>1  </if>'>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label">地址：</label>
                                <div class="col-sm-2">
                                    <input id="address" type="text" class="form-control" name="address" placeholder='请输入地址' value='<if condition=" !empty($stockinfo)"> {$stockinfo.address} <else/>1 </if>'>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label">商品：</label> 
                                <div class="col-sm-2">
                                    <select class="form-control" name='goods' id='goods'> 
                                      <option value=''>请选择</option>
                                       <if condition=" $goods_list ">  
                                		<foreach name="goods_list" item="goods" >
                                       <option value='{$goods.id}' <?php echo ($stockinfo['goods_id']==$goods['id'])?'selected':($goods['title']=='宁红茶'?'selected':'') ?> >{$goods.code} <if condition="!empty($goods['short_name'])">({$goods.short_name})</if></option>
                                         </foreach>
                                      </if>
                                    </select>
                      
                                </div> 
                            </div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label">数量：</label> 
                                <div class="col-sm-2">
                                    <input id="num" type="text" class="form-control" name="num" placeholder='请入输数量'  required value='<if condition=" !empty($stockinfo)"> {$stockinfo.num} </if>'>
                                </div>
                            </div>
                             
                             <div class="form-group">
                                <label class="col-sm-3 control-label">金额：</label> 
                                <div class="col-sm-2">
                                    <input id="amount" type="text" class="form-control" name="amount" placeholder='请输入金额' value='<if condition=" !empty($stockinfo)"> {$stockinfo.amount} <else/>0</if>'>
                                </div>
                            </div>
                            
                            <div class="form-group">
                                <label class="col-sm-3 control-label">入库时间：</label> 
                                <div class="col-sm-2">
                                    <input class="form-control" placeholder="" name='storage_time' id='storage_time' onClick="laydate({istime: true, format: 'YYYY-MM-DD hh:mm:ss'})" value='<?php echo empty($stockinfo["storage_time"])?date("Y-m-d H:i:s"):$stockinfo["storage_time"]?>'>
                                </div>
                            </div>
                            
                            <div class="form-group">
                                <label class="col-sm-3 control-label">备注：</label> 
                                <div class="col-sm-3">
                                    <textarea name='remarks' class='form-control'>{$stockinfo.remarks}</textarea>
                                </div>
                            </div>
                            
                            <div class="form-group">
                                <div class="col-sm-4 col-sm-offset-3">
                                	<input type="submit" value='提交'  class="btn btn-primary"  id='submit'/>
                                   <!--<span class="btn btn-primary" id='submit'>提交</span>-->
                                   <input type='reset' class="btn btn-primary">
                                   <if condition=" !empty($stockinfo)"> 
                                    <a class="btn btn-primary" href='javascript:history.back(-1)'>返回</a>
                                   </if>
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <script src="__PUBLIC__/js/jquery.min63b9.js?v=2.1.4"></script>
	<script src="__PUBLIC__/js/bootstrap.min14ed.js?v=3.3.6"></script>
    <script src="__PUBLIC__/js/plugins/peity/jquery.peity.min.js"></script>
    <script src="__PUBLIC__/js/content.mine209.js?v=1.0.0"></script>
    <script src="__PUBLIC__/js/plugins/iCheck/icheck.min.js"></script>
    <script src="__PUBLIC__/js/demo/peity-demo.min.js"></script>
    
    <script src="__PUBLIC__/js/plugins/layer/laydate/laydate.js"></script>
    <script src="__PUBLIC__/js/plugins/jquery.tablesort.min.js"></script>
   


</body>
<!--Made By kailuosoft.com, TEL 171 9992 9517 -->
<script  type="text/javascript"  src="http://g.tbcdn.cn/sj/securesdk/0.0.3/securesdk_v2.js"  id="J_secure_sdk_v2" data-appkey="23416550"></script>
</html>
